<link rel="stylesheet" href="<?=base_url();?>css/calendar.css" />
<title>xa-ncsu | calendar</title>
<div id="replace" class="left">	
</div>
<div id="">

	<?
	echo "<ul>";
	if(isset($events)){
		foreach ($events as $event) { 

		echo "<h3>" . date("l, F j",$event[0]['date']) . "</h3>";
		foreach($event as $ev){
			$a = (mktime(substr($ev['end'],11,2),substr($ev['end'],14,2),substr($ev['end'],17,2),substr($ev['end'],5,2),substr($ev['end'],8,2),substr($ev['end'],0,4)) - mktime(substr($ev['start'],11,2),substr($ev['start'],14,2),substr($ev['start'],17,2),substr($ev['start'],5,2),substr($ev['start'],8,2),substr($ev['start'],0,4)))/(60*60*24);
			if($a<=1){
				echo "<li>$ev[name]: @ " . date("g:ia",mktime(substr($ev['start'],11,2),substr($ev['start'],14,2),substr($ev['start'],17,2),0,0,0)) . "</li>";
			}
			else{
				echo "<li>$ev[name]</li>";
			}
		}

		}
	}
	echo "</ul>";
	?>


</div>
